import service from "@/api/index.js";
import qs from 'qs'
const collectApi = {
    //收藏
    insert(goodsId){
        return service.post(`/collect/${goodsId}`);
    },
    //取消收藏
    delete(id){
        return service.delete(`/collect/${id}`);
    },
    //根据商品id和用户id查询
    selectByGoodsIdAndUserId(goodsId){
        return service.get(`/collect/${goodsId}`)
    },
    //根据用户id查询所有收藏
    selectByPage(pageNum,pageSize){
        let page = {}
        page.pageNum = pageNum;
        page.pageSize = pageSize;
        return service.get("/collect",{
            params:page
        })
    }
};
export default collectApi;